The Tab View Component > FTabView.getSelectedItem()

 

FTabView.getSelectedItem()

Availability

Flash Player 6.

Usage

myTab_tbv.getSelectedItem ()

Parameters

none

Returns


Returns an Object representing the currently selected item.

 

Description

Returns an Object representing the currently selected item. The object will have at least one property which is used to define the label for the tab. The default name of that property is "label".

 

Notes

The name of the property that contains the name of the tab can be changed using the setLabelField method. The default value is "label".

 

Example

The following code adds two tabs to the component, set the selected tab to the second, and then traces its label.

myTab_tbv.addItem( "Tab1" );
myTab_tbv.addItem( "Tab2" );
myTab_tbv.setSelectedIndex( 1 );
trace( "Item: " + myTab_tbv.getSelectedItem( ).label ); //traces "Item: Tab2"

 

See also

FTabView.getLabelField()

FTabView.getValue()

FTabView.setLabelField()